using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using ICP_MS.Plugin.Experiment.Properties;

namespace ICP_MS.Plugin.Experiment;

public class FormReport : Form
{
	private ExperimentDatas experiment = null;

	private string[] zoomFactors = new string[9]
	{
		"20%",
		"50%",
		"75%",
		"100%",
		"150%",
		"200%",
		"300%",
		"500%",
		Lang.Txt("AddFormReport.Automatic")
	};

	private Type _t;

	private FieldInfo _Position;

	private MethodInfo _SetPositionMethod;

	private bool isMouseDown;

	private Point startPosition;

	private Point endPosition;

	private Point curPosition;

	private IContainer components = null;

	private ToolStrip toolStrip1;

	private ToolStripSeparator toolStripSeparator1;

	private Panel panel1;

	private CheckBox chkCPS;

	private CheckBox chkUCPS;

	private CheckBox chkConc;

	private CheckBox chkCurve;

	private CheckBox chkStd;

	private CheckBox chkCondition;

	private ToolStripButton tsbtnLast;

	private ToolStripButton tsbtnNext;

	private PrintPreviewControl preview;

	private ToolStripComboBox tscbZoom;

	private TextBox txtTitle;

	private Label lblTitle;

	private TextBox txtHeader;

	private Label lblHeader;

	private GroupBox groupBox1;

	private PictureBox picLogo;

	private ToolStripTextBox tstxtPage;

	private ToolStripLabel toolStripLabel1;

	private ToolStripTextBox tstxtTotalpage;

	private ToolStripSeparator toolStripSeparator2;

	private ToolStripButton tsbtnZoomIn;

	private ToolStripButton tsbtnZoomOut;

	private DateTimePicker dtPicker;

	private CheckBox checkBoxData;

	private CheckBox chkRatio;

	private ToolStripButton tsbtnRefresh;

	private ToolStripButton tsbtnPrint;

	private TabControl tabControl1;

	private TabPage tabPage1;

	private GroupBox groupBox3;

	private CheckBox chkAudit;

	private CheckBox chkCheck;

	private CheckBox chkAnalysis;

	public FormReport()
	{
		InitializeComponent();
	}

	public void SetParams(ExperimentDatas datas, ExperimentDB db)
	{
		experiment = datas;
	}

	private void FormReport_Load(object sender, EventArgs e)
	{
		base.WindowState = FormWindowState.Maximized;
		tscbZoom.Items.Clear();
		ComboBox.ObjectCollection items = tscbZoom.Items;
		object[] items2 = zoomFactors;
		items.AddRange(items2);
		_t = typeof(PrintPreviewControl);
		_Position = _t.GetField("position", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.ExactBinding);
		_SetPositionMethod = _t.GetMethod("SetPositionNoInvalidate", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.ExactBinding);
		chkConc.Checked = experiment.ReportParams.ShowConc;
		chkCondition.Checked = experiment.ReportParams.ShowCond;
		chkCPS.Checked = experiment.ReportParams.ShowCPS;
		chkUCPS.Checked = experiment.ReportParams.ShowUCPS;
		chkCurve.Checked = experiment.ReportParams.ShowCurve;
		string path = "//iMassConfig//InstrumentType.txt";
		InstrumentType instrumentType = new InstrumentType();
		try
		{
			using StreamReader sr = File.OpenText(Application.StartupPath + path);
			instrumentType.InstruType = int.Parse(sr.ReadLine());
		}
		catch (Exception)
		{
			instrumentType.InstruType = 0;
		}
		if (experiment.ReportParams.Header == "")
		{
			if (instrumentType != null)
			{
				switch (instrumentType.InstruType)
				{
				case 0:
					experiment.ReportParams.Header = "钢研纳克检测技术股份有限公司";
					break;
				case 1:
					experiment.ReportParams.Header = "广州禾信仪器股份有限公司";
					break;
				case 2:
					experiment.ReportParams.Header = "上海美析仪器有限公司";
					break;
				case 3:
					experiment.ReportParams.Header = "";
					break;
				default:
					experiment.ReportParams.Header = "";
					break;
				}
			}
			else
			{
				experiment.ReportParams.Header = "钢研纳克检测技术股份有限公司";
			}
		}
		if (experiment.ReportParams.Title == "")
		{
			if (instrumentType != null)
			{
				switch (instrumentType.InstruType)
				{
				case 0:
					experiment.ReportParams.Title = "MS300 测试结果";
					break;
				case 1:
					experiment.ReportParams.Title = "ICP-MS 1000 测试结果";
					break;
				case 2:
					experiment.ReportParams.Title = "ICP-MS 6880 测试结果";
					break;
				case 3:
					experiment.ReportParams.Title = "";
					break;
				default:
					experiment.ReportParams.Title = "";
					break;
				}
			}
			else
			{
				experiment.ReportParams.Title = "MS300 测试结果";
			}
		}
		txtHeader.Text = experiment.ReportParams.Header;
		txtTitle.Text = experiment.ReportParams.Title;
		chkAnalysis.Checked = experiment.ReportParams.ShowAnalysisP;
		chkAudit.Checked = experiment.ReportParams.ShowAuditP;
		chkCheck.Checked = experiment.ReportParams.ShowCheckP;
		if (experiment.ReportParams.Logo != null)
		{
			Bitmap b = (Bitmap)XmlBinary.Deserialize(experiment.ReportParams.Logo);
			picLogo.Image = b;
		}
		else
		{
			if (instrumentType != null)
			{
				switch (instrumentType.InstruType)
				{
				case 0:
					experiment.ReportParams.Logo = XmlBinary.Serialize(Resources.ncsLogo);
					break;
				case 1:
					experiment.ReportParams.Logo = XmlBinary.Serialize(Resources.HexinLogo);
					break;
				case 2:
					experiment.ReportParams.Logo = XmlBinary.Serialize(Resources.MACY_Logo);
					break;
				}
			}
			else
			{
				experiment.ReportParams.Logo = XmlBinary.Serialize(Resources.ncsLogo);
			}
			Bitmap b2 = (Bitmap)XmlBinary.Deserialize(experiment.ReportParams.Logo);
			picLogo.Image = b2;
		}
		txtHeader.Text = experiment.ReportParams.Header;
		txtTitle.Text = experiment.ReportParams.Title;
		ApplyResources();
	}

	private void ApplyResources()
	{
		lblHeader.Text = Lang.Txt("FormReport.Items.Headers.Text");
		lblTitle.Text = Lang.Txt("FormReport.Items.Title.Text");
		chkConc.Text = Lang.Txt("FormReport.Items.Concentration.Text");
		chkCondition.Text = Lang.Txt("FormReport.Items.Condition.Text");
		chkCPS.Text = Lang.Txt("FormReport.Items.CaliIntensity.Text");
		chkCurve.Text = Lang.Txt("FormReport.Items.Curve.Text");
		chkStd.Text = Lang.Txt("FormReport.Items.STDConcentration.Text");
		chkUCPS.Text = Lang.Txt("FormReport.Items.OriIntensity.Text");
		groupBox1.Text = Lang.Txt("FormReport.Logo.Text");
		tsbtnPrint.Text = Lang.Txt("FormReport.Print.Text");
		tsbtnLast.Text = Lang.Txt("FormReport.ForwardPage.Text");
		tsbtnNext.Text = Lang.Txt("FormReport.BackPage.Text");
		tsbtnZoomIn.Text = Lang.Txt("AddFormReport.ZoomIn");
		tsbtnZoomOut.Text = Lang.Txt("AddFormReport.ZoomOut");
		tsbtnRefresh.Text = Lang.Txt("AddFormReport.Refresh");
		tabPage1.Text = Lang.Txt("AddFormReport.TemplateSettings");
		chkRatio.Text = Lang.Txt("AddFormReport.IsotopeRatio");
		groupBox3.Text = Lang.Txt("AddFormReport.SignatureBar");
		chkAnalysis.Text = Lang.Txt("AddFormReport.Analyze");
		chkCheck.Text = Lang.Txt("AddFormReport.Check");
		chkAudit.Text = Lang.Txt("AddFormReport.Review");
		checkBoxData.Text = Lang.Txt("AddFormReport.CustomDate");
	}

	private void CreateDocument(bool isPrint = true, string printername = "")
	{
		GC.Collect(0, GCCollectionMode.Forced);
		int pageindex = 0;
		PrinterSettings printerSettings = null;
		if (isPrint)
		{
			PrintDialog dlg = new PrintDialog();
			dlg.AllowSomePages = true;
			dlg.AllowCurrentPage = true;
			dlg.UseEXDialog = true;
			if (dlg.ShowDialog() != DialogResult.OK)
			{
				return;
			}
			printerSettings = dlg.PrinterSettings;
			pageindex = Convert.ToInt32(tstxtPage.Text);
		}
		tsbtnRefresh.Enabled = false;
		tsbtnPrint.Enabled = false;
		ReportClass report = new ReportClass(experiment);
		ReportClass reportClass = report;
		ReportConfig obj = new ReportConfig
		{
			Logo = picLogo.Image
		};
		string header = (experiment.ReportParams.Header = txtHeader.Text);
		obj.Header = header;
		bool analysisP = (experiment.ReportParams.ShowAnalysisP = chkAnalysis.Checked);
		obj.AnalysisP = analysisP;
		analysisP = (experiment.ReportParams.ShowCheckP = chkCheck.Checked);
		obj.CheckP = analysisP;
		analysisP = (experiment.ReportParams.ShowAuditP = chkAudit.Checked);
		obj.AuditP = analysisP;
		header = (experiment.ReportParams.Title = txtTitle.Text);
		obj.Title = header;
		analysisP = (experiment.ReportParams.ShowCond = chkCondition.Checked);
		obj.Cond = analysisP;
		analysisP = (experiment.ReportParams.ShowCurve = chkCurve.Checked);
		obj.Curve = analysisP;
		analysisP = (experiment.ReportParams.ShowConc = chkConc.Checked);
		obj.Conc = analysisP;
		analysisP = (experiment.ReportParams.ShowCPS = chkCPS.Checked);
		obj.Cps = analysisP;
		analysisP = (experiment.ReportParams.ShowUCPS = chkUCPS.Checked);
		obj.Ucps = analysisP;
		obj.Datatime = dtPicker.Value;
		obj.CustomData = checkBoxData.Checked;
		reportClass.Config = obj;
		report.IsShowRatio = chkRatio.Checked;
		report.EndCreate += delegate
		{
			try
			{
				Invoke((MethodInvoker)delegate
				{
					tsbtnRefresh.Enabled = true;
					tsbtnPrint.Enabled = true;
					if (isPrint)
					{
						report.Document.PrinterSettings.PrinterName = printerSettings.PrinterName;
						foreach (PaperSize paperSize in report.Document.PrinterSettings.PaperSizes)
						{
							if (paperSize.PaperName.Equals("A4"))
							{
								report.Document.PrinterSettings.DefaultPageSettings.PaperSize = paperSize;
								report.Document.DefaultPageSettings.PaperSize = paperSize;
							}
						}
						report.Document.Print();
					}
					else
					{
						tstxtPage.Text = "1";
						tstxtTotalpage.Text = report.TotalPages.ToString();
						preview.Document = report.Document;
						preview.StartPage = 0;
					}
				});
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, Lang.Txt("AddFormReport.Warn"), MessageBoxButtons.OK);
			}
			GC.Collect(0, GCCollectionMode.Forced);
		};
		report.CreateDocument(printerSettings, pageindex);
	}

	private void btnRefresh_Click(object sender, EventArgs e)
	{
		CreateDocument(isPrint: false);
	}

	private void btnPrint_Click(object sender, EventArgs e)
	{
		CreateDocument();
	}

	private void tsbtnLast_Click(object sender, EventArgs e)
	{
		if (preview.StartPage > 0)
		{
			preview.StartPage--;
			tstxtPage.Text = (preview.StartPage + 1).ToString();
		}
	}

	private void tsbtnNext_Click(object sender, EventArgs e)
	{
		preview.StartPage++;
		tstxtPage.Text = (preview.StartPage + 1).ToString();
	}

	private void tstxtPage_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode != Keys.Return)
		{
			return;
		}
		int startPage = preview.StartPage;
		try
		{
			int page = Convert.ToInt32(tstxtPage.Text);
			if (page < 1)
			{
				page = 1;
			}
			preview.StartPage = page - 1;
			ToolStripTextBox toolStripTextBox = tstxtPage;
			string text2 = (tstxtPage.Text = (preview.StartPage + 1).ToString());
			toolStripTextBox.Text = text2;
		}
		catch (Exception)
		{
			tstxtPage.Text = startPage.ToString();
		}
	}

	private int GetNextFactor(int factor, int type)
	{
		int nearst = 1000;
		int index = -1;
		for (int i = 0; i < zoomFactors.Length - 1; i++)
		{
			int f = Convert.ToInt32(zoomFactors[i].Substring(0, zoomFactors[i].Length - 1));
			if (type == -1 && f < factor)
			{
				index = i;
				break;
			}
			if (type == 1 && f > factor)
			{
				index = i;
				break;
			}
		}
		if (index == -1)
		{
			index = ((type != -1) ? (zoomFactors.Length - 2) : 0);
		}
		return Convert.ToInt32(zoomFactors[index].Substring(0, zoomFactors[index].Length - 1));
	}

	private void tsbtnZoomIn_Click(object sender, EventArgs e)
	{
		int current = (int)(preview.Zoom * 100.0);
		int facotr = GetNextFactor(current, 1);
		preview.Zoom = (double)facotr / 100.0;
		tscbZoom.Text = facotr + "%";
	}

	private void tsbtnZoomOut_Click(object sender, EventArgs e)
	{
		int current = (int)(preview.Zoom * 100.0);
		int facotr = GetNextFactor(current, -1);
		preview.Zoom = (double)facotr / 100.0;
		tscbZoom.Text = facotr + "%";
	}

	private void tscbZoom_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			int current = (int)(preview.Zoom * 100.0);
			int factor = 0;
			try
			{
				string sfactor = tscbZoom.Text.Replace('%', ' ').Trim();
				factor = Convert.ToInt32(sfactor);
				preview.Zoom = (double)factor / 100.0;
			}
			catch (Exception)
			{
				factor = current;
			}
			tscbZoom.Text = factor + "%";
		}
	}

	private void tscbZoom_SelectedIndexChanged(object sender, EventArgs e)
	{
		int factor = 0;
		if (tscbZoom.SelectedIndex == zoomFactors.Length - 1)
		{
			preview.AutoZoom = true;
			preview.Refresh();
			factor = (int)(preview.Zoom * 100.0);
		}
		else
		{
			string sfactor = tscbZoom.Text.Replace('%', ' ').Trim();
			factor = Convert.ToInt32(sfactor);
			preview.Zoom = (double)factor / 100.0;
		}
		tscbZoom.Text = factor + "%";
	}

	private void preview_MouseDown(object sender, MouseEventArgs e)
	{
		try
		{
			isMouseDown = true;
			startPosition = new Point(e.X, e.Y);
			curPosition = (Point)_Position.GetValue(preview);
		}
		catch
		{
		}
		if (preview.Document != null)
		{
			Cursor = Cursors.SizeAll;
		}
	}

	private void preview_MouseMove(object sender, MouseEventArgs e)
	{
		if (isMouseDown)
		{
			try
			{
				endPosition = new Point(e.X, e.Y);
				_SetPositionMethod.Invoke(preview, new object[1]
				{
					new Point(curPosition.X + (startPosition.X - endPosition.X), curPosition.Y + (startPosition.Y - endPosition.Y))
				});
			}
			catch
			{
			}
		}
	}

	private void preview_MouseUp(object sender, MouseEventArgs e)
	{
		try
		{
			isMouseDown = false;
			endPosition = new Point(e.X, e.Y);
			_SetPositionMethod.Invoke(preview, new object[1]
			{
				new Point(curPosition.X + (startPosition.X - endPosition.X), curPosition.Y + (startPosition.Y - endPosition.Y))
			});
		}
		catch
		{
		}
		if (preview.Document != null)
		{
			Cursor = Cursors.Arrow;
		}
	}

	private void picLogo_MouseDoubleClick(object sender, MouseEventArgs e)
	{
		using OpenFileDialog dlg = new OpenFileDialog();
		dlg.Filter = "Picture file|*.png;*.jpg;*.bmp";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			Image b = Image.FromFile(dlg.FileName);
			experiment.ReportParams.Logo = XmlBinary.Serialize(b);
			picLogo.Image = new Bitmap(b);
			b.Dispose();
		}
	}

	private void FormReport_FormClosing(object sender, FormClosingEventArgs e)
	{
	}

	private void checkBoxData_CheckedChanged(object sender, EventArgs e)
	{
		if (checkBoxData.Checked)
		{
			dtPicker.Visible = true;
		}
		else
		{
			dtPicker.Visible = false;
		}
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.toolStrip1 = new System.Windows.Forms.ToolStrip();
		this.tsbtnRefresh = new System.Windows.Forms.ToolStripButton();
		this.tsbtnPrint = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnLast = new System.Windows.Forms.ToolStripButton();
		this.tsbtnNext = new System.Windows.Forms.ToolStripButton();
		this.tstxtPage = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
		this.tstxtTotalpage = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnZoomIn = new System.Windows.Forms.ToolStripButton();
		this.tsbtnZoomOut = new System.Windows.Forms.ToolStripButton();
		this.tscbZoom = new System.Windows.Forms.ToolStripComboBox();
		this.panel1 = new System.Windows.Forms.Panel();
		this.groupBox3 = new System.Windows.Forms.GroupBox();
		this.chkAudit = new System.Windows.Forms.CheckBox();
		this.chkCheck = new System.Windows.Forms.CheckBox();
		this.chkAnalysis = new System.Windows.Forms.CheckBox();
		this.checkBoxData = new System.Windows.Forms.CheckBox();
		this.dtPicker = new System.Windows.Forms.DateTimePicker();
		this.txtTitle = new System.Windows.Forms.TextBox();
		this.lblTitle = new System.Windows.Forms.Label();
		this.txtHeader = new System.Windows.Forms.TextBox();
		this.lblHeader = new System.Windows.Forms.Label();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.picLogo = new System.Windows.Forms.PictureBox();
		this.chkRatio = new System.Windows.Forms.CheckBox();
		this.chkCPS = new System.Windows.Forms.CheckBox();
		this.chkUCPS = new System.Windows.Forms.CheckBox();
		this.chkConc = new System.Windows.Forms.CheckBox();
		this.chkCurve = new System.Windows.Forms.CheckBox();
		this.chkStd = new System.Windows.Forms.CheckBox();
		this.chkCondition = new System.Windows.Forms.CheckBox();
		this.preview = new System.Windows.Forms.PrintPreviewControl();
		this.tabControl1 = new System.Windows.Forms.TabControl();
		this.tabPage1 = new System.Windows.Forms.TabPage();
		this.toolStrip1.SuspendLayout();
		this.panel1.SuspendLayout();
		this.groupBox3.SuspendLayout();
		this.groupBox1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.picLogo).BeginInit();
		this.tabControl1.SuspendLayout();
		this.tabPage1.SuspendLayout();
		base.SuspendLayout();
		this.toolStrip1.AutoSize = false;
		this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
		this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[12]
		{
			this.tsbtnRefresh, this.tsbtnPrint, this.toolStripSeparator1, this.tsbtnLast, this.tsbtnNext, this.tstxtPage, this.toolStripLabel1, this.tstxtTotalpage, this.toolStripSeparator2, this.tsbtnZoomIn,
			this.tsbtnZoomOut, this.tscbZoom
		});
		this.toolStrip1.Location = new System.Drawing.Point(0, 0);
		this.toolStrip1.Name = "toolStrip1";
		this.toolStrip1.Size = new System.Drawing.Size(1113, 44);
		this.toolStrip1.TabIndex = 4;
		this.toolStrip1.Text = "toolStrip1";
		this.tsbtnRefresh.AutoSize = false;
		this.tsbtnRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnRefresh.Image = ICP_MS.Plugin.Experiment.Properties.Resources.fresh;
		this.tsbtnRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnRefresh.Name = "tsbtnRefresh";
		this.tsbtnRefresh.Size = new System.Drawing.Size(24, 24);
		this.tsbtnRefresh.Text = "预览";
		this.tsbtnRefresh.Click += new System.EventHandler(btnRefresh_Click);
		this.tsbtnPrint.AutoSize = false;
		this.tsbtnPrint.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnPrint.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Print;
		this.tsbtnPrint.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnPrint.Name = "tsbtnPrint";
		this.tsbtnPrint.Size = new System.Drawing.Size(24, 57);
		this.tsbtnPrint.Text = "打印";
		this.tsbtnPrint.Click += new System.EventHandler(btnPrint_Click);
		this.toolStripSeparator1.Name = "toolStripSeparator1";
		this.toolStripSeparator1.Size = new System.Drawing.Size(6, 44);
		this.tsbtnLast.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnLast.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Back;
		this.tsbtnLast.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnLast.Name = "tsbtnLast";
		this.tsbtnLast.Size = new System.Drawing.Size(29, 41);
		this.tsbtnLast.Text = "前一页";
		this.tsbtnLast.Click += new System.EventHandler(tsbtnLast_Click);
		this.tsbtnNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnNext.Image = ICP_MS.Plugin.Experiment.Properties.Resources.Forward;
		this.tsbtnNext.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnNext.Name = "tsbtnNext";
		this.tsbtnNext.Size = new System.Drawing.Size(29, 41);
		this.tsbtnNext.Text = "后一页";
		this.tsbtnNext.Click += new System.EventHandler(tsbtnNext_Click);
		this.tstxtPage.AutoSize = false;
		this.tstxtPage.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.tstxtPage.Name = "tstxtPage";
		this.tstxtPage.Size = new System.Drawing.Size(35, 27);
		this.tstxtPage.Text = "0";
		this.tstxtPage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
		this.tstxtPage.KeyDown += new System.Windows.Forms.KeyEventHandler(tstxtPage_KeyDown);
		this.toolStripLabel1.Name = "toolStripLabel1";
		this.toolStripLabel1.Size = new System.Drawing.Size(15, 41);
		this.toolStripLabel1.Text = "/";
		this.tstxtTotalpage.AutoSize = false;
		this.tstxtTotalpage.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.tstxtTotalpage.Name = "tstxtTotalpage";
		this.tstxtTotalpage.ReadOnly = true;
		this.tstxtTotalpage.Size = new System.Drawing.Size(35, 27);
		this.tstxtTotalpage.Text = "0";
		this.tstxtTotalpage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
		this.toolStripSeparator2.Name = "toolStripSeparator2";
		this.toolStripSeparator2.Size = new System.Drawing.Size(6, 44);
		this.tsbtnZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnZoomIn.Image = ICP_MS.Plugin.Experiment.Properties.Resources.ZoomIn;
		this.tsbtnZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnZoomIn.Name = "tsbtnZoomIn";
		this.tsbtnZoomIn.Size = new System.Drawing.Size(29, 41);
		this.tsbtnZoomIn.Text = "放大";
		this.tsbtnZoomIn.Click += new System.EventHandler(tsbtnZoomIn_Click);
		this.tsbtnZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnZoomOut.Image = ICP_MS.Plugin.Experiment.Properties.Resources.ZoomOut;
		this.tsbtnZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnZoomOut.Name = "tsbtnZoomOut";
		this.tsbtnZoomOut.Size = new System.Drawing.Size(29, 41);
		this.tsbtnZoomOut.Text = "缩小";
		this.tsbtnZoomOut.Click += new System.EventHandler(tsbtnZoomOut_Click);
		this.tscbZoom.AutoSize = false;
		this.tscbZoom.Items.AddRange(new object[7] { "20%", "50%", "75%", "100%", "150%", "200%", "300%" });
		this.tscbZoom.Name = "tscbZoom";
		this.tscbZoom.Size = new System.Drawing.Size(79, 28);
		this.tscbZoom.Text = "100%";
		this.tscbZoom.SelectedIndexChanged += new System.EventHandler(tscbZoom_SelectedIndexChanged);
		this.tscbZoom.KeyDown += new System.Windows.Forms.KeyEventHandler(tscbZoom_KeyDown);
		this.panel1.BackColor = System.Drawing.SystemColors.Control;
		this.panel1.Controls.Add(this.groupBox3);
		this.panel1.Controls.Add(this.checkBoxData);
		this.panel1.Controls.Add(this.dtPicker);
		this.panel1.Controls.Add(this.txtTitle);
		this.panel1.Controls.Add(this.lblTitle);
		this.panel1.Controls.Add(this.txtHeader);
		this.panel1.Controls.Add(this.lblHeader);
		this.panel1.Controls.Add(this.groupBox1);
		this.panel1.Controls.Add(this.chkRatio);
		this.panel1.Controls.Add(this.chkCPS);
		this.panel1.Controls.Add(this.chkUCPS);
		this.panel1.Controls.Add(this.chkConc);
		this.panel1.Controls.Add(this.chkCurve);
		this.panel1.Controls.Add(this.chkStd);
		this.panel1.Controls.Add(this.chkCondition);
		this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel1.Location = new System.Drawing.Point(3, 3);
		this.panel1.Margin = new System.Windows.Forms.Padding(4);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(299, 705);
		this.panel1.TabIndex = 5;
		this.groupBox3.Controls.Add(this.chkAudit);
		this.groupBox3.Controls.Add(this.chkCheck);
		this.groupBox3.Controls.Add(this.chkAnalysis);
		this.groupBox3.Location = new System.Drawing.Point(7, 473);
		this.groupBox3.Name = "groupBox3";
		this.groupBox3.Size = new System.Drawing.Size(272, 134);
		this.groupBox3.TabIndex = 9;
		this.groupBox3.TabStop = false;
		this.groupBox3.Text = "签名栏";
		this.chkAudit.AutoSize = true;
		this.chkAudit.Location = new System.Drawing.Point(12, 108);
		this.chkAudit.Name = "chkAudit";
		this.chkAudit.Size = new System.Drawing.Size(59, 20);
		this.chkAudit.TabIndex = 9;
		this.chkAudit.Text = "审核";
		this.chkAudit.UseVisualStyleBackColor = true;
		this.chkCheck.AutoSize = true;
		this.chkCheck.Location = new System.Drawing.Point(12, 69);
		this.chkCheck.Name = "chkCheck";
		this.chkCheck.Size = new System.Drawing.Size(59, 20);
		this.chkCheck.TabIndex = 9;
		this.chkCheck.Text = "校核";
		this.chkCheck.UseVisualStyleBackColor = true;
		this.chkAnalysis.AutoSize = true;
		this.chkAnalysis.Location = new System.Drawing.Point(12, 36);
		this.chkAnalysis.Name = "chkAnalysis";
		this.chkAnalysis.Size = new System.Drawing.Size(59, 20);
		this.chkAnalysis.TabIndex = 9;
		this.chkAnalysis.Text = "分析";
		this.chkAnalysis.UseVisualStyleBackColor = true;
		this.checkBoxData.AutoSize = true;
		this.checkBoxData.Location = new System.Drawing.Point(7, 626);
		this.checkBoxData.Margin = new System.Windows.Forms.Padding(4);
		this.checkBoxData.Name = "checkBoxData";
		this.checkBoxData.Size = new System.Drawing.Size(107, 20);
		this.checkBoxData.TabIndex = 14;
		this.checkBoxData.Text = "自定义日期:";
		this.checkBoxData.UseVisualStyleBackColor = true;
		this.checkBoxData.CheckedChanged += new System.EventHandler(checkBoxData_CheckedChanged);
		this.dtPicker.Location = new System.Drawing.Point(6, 653);
		this.dtPicker.Margin = new System.Windows.Forms.Padding(4);
		this.dtPicker.Name = "dtPicker";
		this.dtPicker.Size = new System.Drawing.Size(273, 22);
		this.dtPicker.TabIndex = 13;
		this.dtPicker.Value = new System.DateTime(2017, 5, 26, 0, 0, 0, 0);
		this.dtPicker.Visible = false;
		this.txtTitle.Location = new System.Drawing.Point(7, 438);
		this.txtTitle.Margin = new System.Windows.Forms.Padding(4);
		this.txtTitle.Name = "txtTitle";
		this.txtTitle.Size = new System.Drawing.Size(272, 22);
		this.txtTitle.TabIndex = 10;
		this.lblTitle.AutoSize = true;
		this.lblTitle.Location = new System.Drawing.Point(4, 418);
		this.lblTitle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblTitle.Name = "lblTitle";
		this.lblTitle.Size = new System.Drawing.Size(40, 16);
		this.lblTitle.TabIndex = 9;
		this.lblTitle.Text = "标题:";
		this.txtHeader.Location = new System.Drawing.Point(7, 387);
		this.txtHeader.Margin = new System.Windows.Forms.Padding(4);
		this.txtHeader.Name = "txtHeader";
		this.txtHeader.Size = new System.Drawing.Size(272, 22);
		this.txtHeader.TabIndex = 8;
		this.lblHeader.AutoSize = true;
		this.lblHeader.Location = new System.Drawing.Point(7, 368);
		this.lblHeader.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblHeader.Name = "lblHeader";
		this.lblHeader.Size = new System.Drawing.Size(40, 16);
		this.lblHeader.TabIndex = 7;
		this.lblHeader.Text = "页眉:";
		this.groupBox1.Controls.Add(this.picLogo);
		this.groupBox1.Location = new System.Drawing.Point(15, 22);
		this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox1.Size = new System.Drawing.Size(225, 94);
		this.groupBox1.TabIndex = 6;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "Logo";
		this.picLogo.Dock = System.Windows.Forms.DockStyle.Fill;
		this.picLogo.Image = ICP_MS.Plugin.Experiment.Properties.Resources.ncsLogo;
		this.picLogo.Location = new System.Drawing.Point(4, 19);
		this.picLogo.Margin = new System.Windows.Forms.Padding(4);
		this.picLogo.Name = "picLogo";
		this.picLogo.Size = new System.Drawing.Size(217, 71);
		this.picLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
		this.picLogo.TabIndex = 0;
		this.picLogo.TabStop = false;
		this.picLogo.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(picLogo_MouseDoubleClick);
		this.chkRatio.AutoSize = true;
		this.chkRatio.Location = new System.Drawing.Point(19, 330);
		this.chkRatio.Margin = new System.Windows.Forms.Padding(4);
		this.chkRatio.Name = "chkRatio";
		this.chkRatio.Size = new System.Drawing.Size(104, 20);
		this.chkRatio.TabIndex = 5;
		this.chkRatio.Text = "同位素比率";
		this.chkRatio.UseVisualStyleBackColor = true;
		this.chkCPS.AutoSize = true;
		this.chkCPS.Checked = true;
		this.chkCPS.CheckState = System.Windows.Forms.CheckState.Checked;
		this.chkCPS.Location = new System.Drawing.Point(19, 291);
		this.chkCPS.Margin = new System.Windows.Forms.Padding(4);
		this.chkCPS.Name = "chkCPS";
		this.chkCPS.Size = new System.Drawing.Size(89, 20);
		this.chkCPS.TabIndex = 5;
		this.chkCPS.Text = "校正强度";
		this.chkCPS.UseVisualStyleBackColor = true;
		this.chkUCPS.AutoSize = true;
		this.chkUCPS.Checked = true;
		this.chkUCPS.CheckState = System.Windows.Forms.CheckState.Checked;
		this.chkUCPS.Location = new System.Drawing.Point(19, 252);
		this.chkUCPS.Margin = new System.Windows.Forms.Padding(4);
		this.chkUCPS.Name = "chkUCPS";
		this.chkUCPS.Size = new System.Drawing.Size(89, 20);
		this.chkUCPS.TabIndex = 4;
		this.chkUCPS.Text = "原始强度";
		this.chkUCPS.UseVisualStyleBackColor = true;
		this.chkConc.AutoSize = true;
		this.chkConc.Checked = true;
		this.chkConc.CheckState = System.Windows.Forms.CheckState.Checked;
		this.chkConc.Location = new System.Drawing.Point(19, 212);
		this.chkConc.Margin = new System.Windows.Forms.Padding(4);
		this.chkConc.Name = "chkConc";
		this.chkConc.Size = new System.Drawing.Size(89, 20);
		this.chkConc.TabIndex = 3;
		this.chkConc.Text = "计算浓度";
		this.chkConc.UseVisualStyleBackColor = true;
		this.chkCurve.AutoSize = true;
		this.chkCurve.Checked = true;
		this.chkCurve.CheckState = System.Windows.Forms.CheckState.Checked;
		this.chkCurve.Location = new System.Drawing.Point(19, 173);
		this.chkCurve.Margin = new System.Windows.Forms.Padding(4);
		this.chkCurve.Name = "chkCurve";
		this.chkCurve.Size = new System.Drawing.Size(89, 20);
		this.chkCurve.TabIndex = 2;
		this.chkCurve.Text = "工作曲线";
		this.chkCurve.UseVisualStyleBackColor = true;
		this.chkStd.AutoSize = true;
		this.chkStd.Location = new System.Drawing.Point(176, 720);
		this.chkStd.Margin = new System.Windows.Forms.Padding(4);
		this.chkStd.Name = "chkStd";
		this.chkStd.Size = new System.Drawing.Size(89, 20);
		this.chkStd.TabIndex = 1;
		this.chkStd.Text = "标准浓度";
		this.chkStd.UseVisualStyleBackColor = true;
		this.chkStd.Visible = false;
		this.chkCondition.AutoSize = true;
		this.chkCondition.Checked = true;
		this.chkCondition.CheckState = System.Windows.Forms.CheckState.Checked;
		this.chkCondition.Location = new System.Drawing.Point(19, 133);
		this.chkCondition.Margin = new System.Windows.Forms.Padding(4);
		this.chkCondition.Name = "chkCondition";
		this.chkCondition.Size = new System.Drawing.Size(89, 20);
		this.chkCondition.TabIndex = 0;
		this.chkCondition.Text = "分析条件";
		this.chkCondition.UseVisualStyleBackColor = true;
		this.preview.Dock = System.Windows.Forms.DockStyle.Fill;
		this.preview.Location = new System.Drawing.Point(0, 44);
		this.preview.Margin = new System.Windows.Forms.Padding(4);
		this.preview.Name = "preview";
		this.preview.Size = new System.Drawing.Size(1113, 740);
		this.preview.TabIndex = 6;
		this.preview.MouseDown += new System.Windows.Forms.MouseEventHandler(preview_MouseDown);
		this.preview.MouseMove += new System.Windows.Forms.MouseEventHandler(preview_MouseMove);
		this.preview.MouseUp += new System.Windows.Forms.MouseEventHandler(preview_MouseUp);
		this.tabControl1.Controls.Add(this.tabPage1);
		this.tabControl1.Dock = System.Windows.Forms.DockStyle.Left;
		this.tabControl1.Location = new System.Drawing.Point(0, 44);
		this.tabControl1.Name = "tabControl1";
		this.tabControl1.SelectedIndex = 0;
		this.tabControl1.Size = new System.Drawing.Size(313, 740);
		this.tabControl1.TabIndex = 7;
		this.tabPage1.Controls.Add(this.panel1);
		this.tabPage1.Location = new System.Drawing.Point(4, 25);
		this.tabPage1.Name = "tabPage1";
		this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
		this.tabPage1.Size = new System.Drawing.Size(305, 711);
		this.tabPage1.TabIndex = 0;
		this.tabPage1.Text = "模板设置";
		this.tabPage1.UseVisualStyleBackColor = true;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 16f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1113, 784);
		base.Controls.Add(this.tabControl1);
		base.Controls.Add(this.preview);
		base.Controls.Add(this.toolStrip1);
		base.Margin = new System.Windows.Forms.Padding(4);
		base.Name = "FormReport";
		base.ShowIcon = false;
		this.Text = " ";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormReport_FormClosing);
		base.Load += new System.EventHandler(FormReport_Load);
		this.toolStrip1.ResumeLayout(false);
		this.toolStrip1.PerformLayout();
		this.panel1.ResumeLayout(false);
		this.panel1.PerformLayout();
		this.groupBox3.ResumeLayout(false);
		this.groupBox3.PerformLayout();
		this.groupBox1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.picLogo).EndInit();
		this.tabControl1.ResumeLayout(false);
		this.tabPage1.ResumeLayout(false);
		base.ResumeLayout(false);
	}
}
